﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Jiz.App.Domain
{
    public class AppDbContext : DbContext
    {
        static AppDbContext()
        {
            Database.SetInitializer<AppDbContext>(null);
        }

        public AppDbContext()
            : base("name=jzsport-db")
        {
        }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Jiz.App.Domain.Models.AdClickRecord>().ToTable("App_AdClickRecord");
            modelBuilder.Entity<Jiz.App.Domain.Models.AdClickRecord>().HasKey(p => p.Id);
            modelBuilder.Entity<Jiz.App.Domain.Models.MACNickname>().ToTable("app_macnickname");
            modelBuilder.Entity<Jiz.App.Domain.Models.MACNickname>().HasKey(p => p.Id);

            //do something
            base.OnModelCreating(modelBuilder);
        }
    }
}